package org.elepower.controller;

import org.elepower.dao.InspectiontaskDetailsDao;
import org.elepower.dao.PoleDao;
import org.elepower.dao.PsInspectorDetailsDao;
import org.elepower.pojo.PsInspectiontaskDetails;
import org.elepower.pojo.PsInspectorDetails;
import org.elepower.pojo.PsPoleInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/taskDetail")
public class InspectiontaskDetialController{
    @Autowired
    private PsInspectorDetailsDao inspectorDetailsDao;
    @Autowired
    private PoleDao poleDao;
    @Autowired
    private InspectiontaskDetailsDao inspectiontaskDetailsDao;

    @RequestMapping("/getTaskId")
    @ResponseBody
    public List<PsInspectorDetails> getTaskId(String taskId) throws Exception{
        return inspectorDetailsDao.getTaskId(Integer.parseInt(taskId));
    }

    @RequestMapping("/getLinePole")
    @ResponseBody
    public List<PsPoleInfo> getLinePole(Integer lineId) throws Exception{
        return poleDao.getLinePole(lineId);
    }

    @RequestMapping("/getInspectaskForTaskId")
    @ResponseBody
    public List<PsInspectiontaskDetails> getInspectaskForTaskId(Integer taskId) throws Exception{
        return inspectiontaskDetailsDao.getTaskId(taskId);
    }
    
}
